package com.example.travelcomponentdemo;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends Activity implements OnItemClickListener {
	
	String[] array = {"Sensor on Map", "EditText as Facebook",
					"Map with line", "Map Circle Line Intersect",
					"Wheel Scroll", "Slider On Off", "Horizontal ListView",
					"Custom ListView", "View Switcher", "Create bitmap from two bitmap",
					"SlideLayout", "Sliding Menu", "Send Notification", "Horizontal Pager",
					"Get Direction On Map", "Popup", "Animation", "Sliding Menu For Map",
					"Blowfish", "Listview Hide TopBar"};
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		ListView list = (ListView) findViewById(R.id.listView1);
		list.setAdapter(new ArrayAdapter<String>(this, R.layout.list_item, array));
		list.setOnItemClickListener(this);
	}
	
	

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int pos, long arg3) {
		Intent i = new Intent();
		switch (pos) {
		case 0:
			i.setClass(this, SensorOnMap.class);
			break;
		case 1:
			i.setClass(this, EditTextAsFacebook.class);
			break;
		case 2:
			i.setClass(this, MapWithLine.class);
			break;
		case 3:
			i.setClass(this, MapCircleLineIntersect.class);
			break;
		case 4:
			i.setClass(this, WheelScrollActivity.class);
			break;
		case 5:
			i.setClass(this, SliderOnOff.class);
			break;
		case 6:
			i.setClass(this, HorizontalListView.class);
			break;
		case 7:
			i.setClass(this, CustomListView.class);
			break;
		case 8:
			i.setClass(this, ViewSwitcherDemo.class);
			break;
		case 9:
			i.setClass(this, CreateBitmapFromTwoBitmap.class);
			break;
		case 10:
			i.setClass(this, SlideLayout.class);
			break;
		case 11:
			i.setClass(this, SlidingMenu.class);
			break;
		case 12:
			i.setClass(this, SendNotification.class);
			break;
		case 13:
			i.setClass(this, HorizontalPagerWithPageControlActivity.class);
			break;
		case 14:
			i.setClass(this, GetDirectionOnMap.class);
			break;
		case 15:
			i.setClass(this, PopupsampleActivity.class);
			break;
		case 16:
			i.setClass(this, AndroidAnimInterpolatorActivity.class);
			break;
		case 17:
			i.setClass(this, SlidingForMap.class);
			break;
		case 18:
			i.setClass(this, UsingBlowfish.class);
			break;
		case 19:
			i.setClass(this, ListHideTopBar.class);
			break;
		default:
			break;
		}
		
		startActivity(i);
	}

}
